package com.hunteron.similarity;

import org.apache.lucene.index.FieldInvertState;

/**
 *
 * @author Smile.Wu
 * @version 2015-5-27
 * 
 * 搜索中，屏蔽关键字的idf影响；
 */
public class HunterOnSimilarity extends DefaultSimilarityHO {
	public static int Portrait_maxWeight = 20;

	@Override
	public float tf(float freq) {
		if(freq <= 0) {
			return 0;
		}
	    return 1f;
	}
	
	@Override
	public float idf(long docFreq, long numDocs) {
		return 1f;
	}
	
//	@Override
//	public float lengthNorm(FieldInvertState state) {
//		return 1f;
//	}
//	
	@Override
	public float queryNorm(float sumOfSquaredWeights) {
		
		return 1f;
	}
	
	@Override
	public void setDiscountOverlaps(boolean v) {
		super.setDiscountOverlaps(v);
	}
	@Override
	public float coord(int overlap, int maxOverlap) {
		return 1f;
	}
	
	@Override
	public float lengthNorm(FieldInvertState state) {
		return 1f;
	}
}
